{% extends "__data_browser__/list.html" %}
{% block lists %}
  <div class="col-lg-10">
    {% if __data__ %}
      {% for grouper, list in __data__|groupby("create_date")|reverse %}
        <div class="panel panel-default">
          <div class="panel-heading">
            {{ grouper }}:{% if grouper == today %}今天{% elif grouper == yesterday %}昨天{% endif %}
          </div>
        </div>
        <div class="panel-body">
          {% for log in list %}
            <blockquote>
              {% set k, v = log.url_map %}
              {% if v %}
                <a href="{{ v }}">
              {% endif %}
              <span class="muted">
                      {{ log.create_time.strftime("%H:%M") }}
                    </span>
              {% if log.obj_cls %}
                {{ log.obj_class }}
                <strong>{{ log.obj }}</strong>
              {% endif %}
              被操作员<strong>{{ log.actor or "" }}</strong>执行了<strong>{{ log.action }}</strong>操作
              {% if log.message %}
                <i class="text-muted">{{ log.message }}</i>
              {% endif %}
              {% if v %}
                </a>
              {% endif %}
            </blockquote>
          {% endfor %}
        </div>
      {% endfor %}
      {% from "__data_browser__/macro.html" import render_pagination %}
      {{ render_pagination(__pagination__, __count__, g.request_from_mobile) }}
    {% else %}
      <p class="alert alert-danger">{{ _("* 没有符合条件的结果") }}</p>
    {% endif %}
  </div>
{% endblock %}

{% block body %}
  {{ sub_nav_bar.as_ul("active")|safe }}
  {{ super() }}
{% endblock %}
